home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / xmcd-1.4 / libdi.d / vu_pion.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-10  |  7.0 KB  |  214 lines

  1. /*
  2.  *   libdi - CD Audio Player Device Interface Library
  3.  *
  4.  *   Copyright (C) 1995  Ti Kan
  5.  *   E-mail: ti@amb.org
  6.  *
  7.  *   This program is free software; you can redistribute it and/or modify
  8.  *   it under the terms of the GNU General Public License as published by
  9.  *   the Free Software Foundation; either version 2 of the License, or
  10.  *   (at your option) any later version.
  11.  *
  12.  *   This program is distributed in the hope that it will be useful,
  13.  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  *   GNU General Public License for more details.
  16.  *
  17.  *   You should have received a copy of the GNU General Public License
  18.  *   along with this program; if not, write to the Free Software
  19.  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  *
  21.  *   The name "Pioneer" is a trademark of Pioneer Corporation, and is
  22.  *   used here for identification purposes only.  This software and its
  23.  *   author are not affiliated in any way with Pioneer.
  24.  *
  25.  */
  26. #ifndef __VU_PION_H__
  27. #define __VU_PION_H__
  28.  
  29. #ifdef VENDOR_PIONEER
  30.  
  31. #ifndef LINT
  32. static char *_vu_pion_h_ident_ = "@(#)vu_pion.h    5.2 94/12/28";
  33. #endif
  34.  
  35.  
  36. /* Pioneer vendor-unique commands */
  37. #define OP_VP_EJECT        0xc0    /* Pioneer magazine eject */
  38. #define OP_VP_RDTOC        0xc1    /* Pioneer read TOC */
  39. #define OP_VP_RDSUBQ        0xc2    /* Pioneer read subcode Q */
  40. #define OP_VP_RDHDR        0xc3    /* Pioneer read header */
  41. #define OP_VP_AUDSRCH        0xc8    /* Pioneer audio search */
  42. #define OP_VP_AUDPLAY        0xc9    /* Pioneer play audio */
  43. #define OP_VP_PAUSE        0xca    /* Pioneer pause */
  44. #define OP_VP_AUDSTOP        0xcb    /* Pioneer audio stop */
  45. #define OP_VP_AUDSTAT        0xcc    /* Pioneer audio status */
  46. #define OP_VP_AUDSCAN        0xcd    /* Pioneer audio scan */
  47. #define OP_VP_RDDSTAT        0xe0    /* Pioneer read drive status */
  48. #define OP_VP_WRCDP        0xe3    /* Pioneer write CDP */
  49. #define OP_VP_RDCDP        0xe4    /* Pioneer read CDP */
  50.  
  51.  
  52. /* Pioneer audio status codes */
  53. #define PAUD_PLAYING        0x00
  54. #define PAUD_PAUSED        0x01
  55. #define PAUD_MUTEPLAY        0x02
  56. #define PAUD_COMPLETED        0x03
  57. #define PAUD_ERROR        0x04
  58. #define PAUD_NOSTATUS        0x05
  59.  
  60.  
  61. /* Return data lengths */
  62. #define SZ_VP_RDTOC        4    /* Pioneer read TOC data size */
  63. #define SZ_VP_RDSUBQ        9    /* Pioneer read subcode Q data size */
  64. #define SZ_VP_AUDSTAT        6    /* Pioneer audio status data size */
  65.  
  66.  
  67. /* Pioneer read audio status command data */
  68. typedef struct paudstat_data {
  69.     unsigned int    status:8;    /* audio status */
  70. #if _BYTE_ORDER_ == _L_ENDIAN_
  71.     unsigned int    mode:4;        /* play mode */
  72.     unsigned int    res1:4;        /* reserved */
  73.     unsigned int    preemph:1;    /* preemphasis off=0 on=1 */
  74.     unsigned int    copyallow:1;    /* digital copy allowed off=0 on=1 */
  75.     unsigned int    trktype:1;    /* 0=audio 1=data */
  76.     unsigned int    audioch:1;    /* 0=2ch 1=4ch */
  77.     unsigned int    res2:4;        /* reserved */
  78. #else    /* _BYTE_ORDER_ == _B_ENDIAN_ */
  79.     unsigned int    res1:4;        /* reserved */
  80.     unsigned int    mode:4;        /* play mode */
  81.     unsigned int    res2:4;        /* reserved */
  82.     unsigned int    audioch:1;    /* 0=2ch 1=4ch */
  83.     unsigned int    trktype:1;    /* 0=audio 1=data */
  84.     unsigned int    copyallow:1;    /* digital copy allowed off=0 on=1 */
  85.     unsigned int    preemph:1;    /* preemphasis off=0 on=1 */
  86. #endif    /* _BYTE_ORDER_ */
  87.     unsigned int    abs_min:8;    /* absolute minutes (BCD) */
  88.  
  89.     unsigned int    abs_sec:8;    /* absolute seconds (BCD) */
  90.     unsigned int    abs_frame:8;    /* absolute frame (BCD) */
  91.     unsigned int    pad1:16;    /* pad for alignment */
  92. } paudstat_data_t;
  93.  
  94.  
  95.  
  96. /* Pioneer read subcode Q command data */
  97. typedef struct psubq_data {
  98. #if _BYTE_ORDER_ == _L_ENDIAN_
  99.     unsigned int    preemph:1;    /* preemphasis off=0 on=1 */
  100.     unsigned int    copyallow:1;    /* digital copy allowed off=0 on=1 */
  101.     unsigned int    trktype:1;    /* 0=audio 1=data */
  102.     unsigned int    audioch:1;    /* 0=2ch 1=4ch */
  103.     unsigned int    res:4;        /* reserved */
  104. #else    /* _BYTE_ORDER_ == _B_ENDIAN_ */
  105.     unsigned int    res:4;        /* reserved */
  106.     unsigned int    audioch:1;    /* 0=2ch 1=4ch */
  107.     unsigned int    trktype:1;    /* 0=audio 1=data */
  108.     unsigned int    copyallow:1;    /* digital copy allowed off=0 on=1 */
  109.     unsigned int    preemph:1;    /* preemphasis off=0 on=1 */
  110. #endif    /* _BYTE_ORDER_ */
  111.     unsigned int    trkno:8;    /* track number (BCD) */
  112.     unsigned int    idxno:8;    /* index number (BCD) */
  113.     unsigned int    rel_min:8;    /* trk relative minutes (BCD) */
  114.  
  115.     unsigned int    rel_sec:8;    /* trk relative seconds (BCD) */
  116.     unsigned int    rel_frame:8;    /* trk relative frame (BCD) */
  117.     unsigned int    abs_min:8;    /* absolute minutes (BCD) */
  118.     unsigned int    abs_sec:8;    /* absolute seconds (BCD) */
  119.  
  120.     unsigned int    abs_frame:8;    /* absolute frame (BCD) */
  121.     unsigned int    pad1:24;    /* pad for alignment */
  122. } psubq_data_t;
  123.  
  124.  
  125. /* Pioneer read TOC command data */
  126. typedef struct pinfo_00 {        /* track information */
  127.     byte_t        first_trk;    /* first track (BCD) */
  128.     byte_t        last_trk;    /* last track (BCD) */
  129.     byte_t        reserved[2];    /* reserved */
  130. } pinfo_00_t;
  131.  
  132. typedef struct pinfo_01 {        /* lead-out track starting time */
  133.     byte_t        min;        /* minutes (BCD) */
  134.     byte_t        sec;        /* seconds (BCD) */
  135.     byte_t        frame;        /* frame (BCD) */
  136.     byte_t        reserved;    /* reserved */
  137. } pinfo_01_t;
  138.  
  139. typedef struct pinfo_02 {        /* specified track starting time */
  140. #if _BYTE_ORDER_ == _L_ENDIAN_
  141.     unsigned int    preemph:1;    /* preemphasis off=0 on=1 */
  142.     unsigned int    copyallow:1;    /* digital copy allowed off=0 on=1 */
  143.     unsigned int    trktype:1;    /* 0=audio 1=data */
  144.     unsigned int    audioch:1;    /* 0=2ch 1=4ch */
  145.     unsigned int    res:4;        /* reserved */
  146. #else    /* _BYTE_ORDER_ == _B_ENDIAN_ */
  147.     unsigned int    res:4;        /* reserved */
  148.     unsigned int    audioch:1;    /* 0=2ch 1=4ch */
  149.     unsigned int    trktype:1;    /* 0=audio 1=data */
  150.     unsigned int    copyallow:1;    /* digital copy allowed off=0 on=1 */
  151.     unsigned int    preemph:1;    /* preemphasis off=0 on=1 */
  152. #endif    /* _BYTE_ORDER_ */
  153.  
  154.     unsigned int    min:8;        /* minutes (BCD) */
  155.     unsigned int    sec:8;        /* seconds (BCD) */
  156.     unsigned int    frame:8;    /* frame (BCD) */
  157. } pinfo_02_t;
  158.  
  159.  
  160. /* Argument of Pioneer audio search and audio play commands */
  161. typedef struct paudio_arg {
  162.     union {                /* address */
  163.         word32_t    tp_00;    /* absolute logical blk addr */
  164. #if _BYTE_ORDER_ == _L_ENDIAN_
  165.         struct {
  166.             byte_t    frame;    /* frame (BCD) */
  167.             byte_t    sec;    /* seconds (BCD) */
  168.             byte_t    min;    /* minutes (BCD) */
  169.             byte_t    res;    /* reserved */
  170.         } tp_01;
  171.         struct {
  172.             byte_t    track;    /* track number (BCD) */
  173.             byte_t    res[3];    /* reserved */
  174.         } tp_10;
  175. #else    /* _BYTE_ORDER_ == _B_ENDIAN_ */
  176.         struct {
  177.             byte_t    res;    /* reserved */
  178.             byte_t    min;    /* minutes (BCD) */
  179.             byte_t    sec;    /* seconds (BCD) */
  180.             byte_t    frame;    /* frame (BCD) */
  181.         } tp_01;
  182.         struct {
  183.             byte_t    res[3];    /* reserved */
  184.             byte_t    track;    /* track number (BCD) */
  185.         } tp_10;
  186. #endif    /* _BYTE_ORDER_ */
  187.     } _addr;
  188. } paudio_arg_t;
  189.  
  190. #define    addr_logical    _addr.tp_00
  191. #define    addr_min    _addr.tp_01.min
  192. #define    addr_sec    _addr.tp_01.sec
  193. #define    addr_frame    _addr.tp_01.frame
  194. #define    addr_track    _addr.tp_10.track
  195.  
  196.  
  197. /* Public function prototypes */
  198. extern bool_t    pion_playaudio(byte_t, word32_t, word32_t, msf_t *, msf_t *,
  199.             byte_t, byte_t);
  200. extern bool_t    pion_pause_resume(bool_t);
  201. extern bool_t    pion_get_playstatus(curstat_t *, byte_t *);
  202. extern bool_t    pion_get_toc(curstat_t *);
  203. extern bool_t    pion_eject(void);
  204. extern void    pion_init(void);
  205.  
  206. #else
  207.  
  208. #define pion_init    NULL
  209.  
  210. #endif    /* VENDOR_PIONEER */
  211.  
  212. #endif    /* __VU_PION_H__ */
  213.  
  214.